home *** CD-ROM | disk | FTP | other *** search
- To everyone who has obtained Tim Mikkelsen's excellent and very
- useful XLISP Reference in ASCII format, the following sed script
- might be of interest to you. It slightly reformats the document
- so that when piped through pr(1), there are no empty pages. It
- also keeps the text within reasonable margins for printing on
- 8.5x11" paper, and provides some additional consistency in tabbing
- and line spacing.
-
- Assuming that you have the files ref1.Z, ref2.Z, ref3.Z, ref4.Z,
- and ref5.Z as provided by Tim Mikkelsen, and the sed script
- contained here has been saved as sedf; the following command, or a
- variation, will produce the reformatted document in the file prt:
-
- $ zcat ref[1-5].Z | sed -f sedf | pr -h "XLISP Reference" > prt
-
- --
- John E Van Deusen III, PO Box 9283, Boise, ID 83707, (208) 343-1865
-
- uunet!visdc!jiii
-
- ===cut here===
- /^[]$/,${
- s/^[ ] / /
- s/^ / /
- s/^ [ ]/ /
- /^ /s/^ */ /
- /^[ ][ ]* [ ][ ]*/s/ //
- /^EXAMPLES$/,/^[^ ]/{
- /^[ ]*$/d
- /^ /!{
- /^EXAMPLES$/a\
-
- /^EXAMPLES$/!{
- /^[]/!i\
-
- }
-
- }
- s/^ //
- }
- /^SYNTAX$/,/^DESCRIPTION$/{
- /^[ ][ ]*<.*>.*-/,/^$/{
- s/- *[ ]/- /
- />.*- /!{
- /^[ ][ ]* /!{
- s/^[ ][ ]*/& /
- }
- s/^ //
- }
- }
- }
- /^DESCRIPTION$/,/^EXAMPLES$/{
- s/ */ /g
- s/\. /\. /g
- }
- /^[A-Z][A-Z ]*:/,/^$/{
- s/ */ /g
- s/\. /\. /g
- }
- /^$/,/^..*/{
- /^$/d
- /^[]$/!i\
-
- }
- /^[]$/,/^.*/{
- /^[]$/d
- /^$/d
- /^.*$/s/^.*$/&/
- }
- }
-
-
-